﻿cmake_minimum_required (VERSION 2.8)
project(ZeroRpc)


if (NOT MSVC)
#set(CFLAGS "-m64")
#添加c++17支持
add_definitions(-std=c++17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -std=c++17 -pthread -ldl ")
else (NOT MSVC)
#添加c++11支持
add_definitions(-std=c++11)
add_definitions(-D WIN32_LEAN_AND_MEAN)
endif (NOT MSVC)

set(CMAKE_INSTALL_PREFIX "./")

#设置第三方库根目录
if(MSVC)
	set(PATH3RD $ENV{Path3rd})
else(MSVC)
	set(PATH3RD "$ENV{HOME}/local")
endif(MSVC)


set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
message("cmake path ${CMAKE_MODULE_PATH}")

LINK_DIRECTORIES(${PATH3RD}/lib)
include_directories(${PATH3RD})

########################################################################
# protobuf dependency
########################################################################
#find_package(protobuf)
#IF (PROTOBUF_FOUND)
#    include_directories(${PROTOBUF_INCLUDE_DIR})
#ELSE (PROTOBUF_FOUND)
#    message( FATAL_ERROR "PROTOBUF_FOUND not found." )
#ENDIF (PROTOBUF_FOUND)



add_subdirectory(util)

add_subdirectory(utiltest)

add_subdirectory(zerorpc)

add_subdirectory(example)
